package com.shhm.admin.controller;

import com.shhm.common.dto.response.AjaxResultPlus;
import com.shhm.common.entity.system.SysLog;
import com.shhm.common.service.LogService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;

/**
 * @author JackZ
 * @version 1.0
 * @description: TODO
 * @date 2025/8/14 下午3:01
 */
@RestController
@RequestMapping("/admin")
public class LogController {
    @Resource
    private LogService logService;

    @GetMapping("/log")
    public AjaxResultPlus pageList(
            @RequestParam(defaultValue = "1") Integer pageNum,
            @RequestParam(defaultValue = "10") Integer pageSize,
            HttpServletRequest request
    ){
        return logService.pageList(pageNum,pageSize,request);
    }
    @PostMapping("/log/search")
    public AjaxResultPlus pageSearchList(
            @RequestParam(defaultValue = "1") Integer pageNum,
            @RequestParam(defaultValue = "10") Integer pageSize,
            @RequestBody SysLog entity
    ){
        return logService.pageSearchList(pageNum,pageSize,entity);
    }
}
